package com.xneure.database.dao.category;

import java.util.List;
import org.apache.ibatis.annotations.SelectProvider;
import com.xneure.database.SqlMappingProvider;
import com.xneure.database.annotation.DaoMapper;
import com.xneure.database.annotation.DynamicResults;
import com.xneure.database.dao.Paging;

@DaoMapper
public interface QueryDao<T>extends DeleteDao<T>{
	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "list")
	public List<T> getList(T obj,Paging page);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "listByWhere")
	public List<T> getListWhere(T obj,String where);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "listByWhere1")
	public List<T> getListClassWhere(Class<T> cls,String where);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "queryByWhere")
	public T queryWhere(T obj,String where);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "queryByWhere1")
	public T queryClassWhere(Class<T> cls,String where);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "query")
	public T query(T obj);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "queryById")
	public T queryById(Class<?> cls,Object id);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "querySql")
	public <O> List<O> queryBySql(Class<O> cls,String sql);

	@DynamicResults
	@SelectProvider(type = SqlMappingProvider.class,method = "querySql")
	public <O> O querySql(Class<O> cls,String sql);
}
